
package xj.graph2d.app.diagram;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenuItem;

import xj.graph2d.app.DrawAction;

public class BuildSequenceDiagramTestListener 
  extends DrawAction 
  implements ActionListener {

  public void actionPerformed(ActionEvent e) {
    if (e != null) { 
      Object src =e.getSource();
      if (src instanceof JMenuItem) { 
	JMenuItem mi = (JMenuItem) src;
	String cmd = mi.getActionCommand(); 
	if ("Sequence1".equals(cmd)) { 
	  test1();
	} else if ("Sequence2".equals(cmd)) { 
	  test2(); 
	}
      }
    }
  }

  private void test1() { 
    SequenceDiagramBuilder builder = new SequenceDiagramBuilder(main, "Sequence Diagram Test 1");
    
    builder.doLayout();
  }

  private void test2() { 
    SequenceDiagramBuilder builder = new SequenceDiagramBuilder(main, "Sequence Diagram Test 2");
    
    builder.doLayout();
  }

}
